import request from '../utils/request'

export function getAllWebsite(params?: Object) {
  return request({
    url: '/webdaohang/daohang-plus-ui/website/getAllWebsite',
    method: 'get',
    params,
  })
}


export function getWebsiteBySearchName(websiteName?: string) {
  return request({
    url: '/webdaohang/daohang-plus-ui/website/getWebsiteBySearchName?websiteName='+websiteName,
    method: 'get'
  })
}


export function getHotWebsiteList() {
  return request({
    url: '/webdaohang/daohang-plus-ui/website/getHotWebsiteList',
    method: 'get'
  })
}

// 新增网站
export function addWebsite(data: {
  menuName: string
  websiteName: string
  websiteUrl: string
  websiteLogo?: string
  websiteRemark?: string
  websiteSort?: number
}) {
  return request({
    url: '/webdaohang/daohang-plus-ui/website/addWebsite',
    method: 'post',
    data,
  })
}

// 更新网站所属菜单
export function updateWebsiteMenu(data: {
  id: number
  menuName: string
}) {
  return request({
    url: '/webdaohang/daohang-plus-ui/website/updateWebsiteMenu',
    method: 'post',
    data,
  })
}